/****
 * 控制彩色RED
 * author： sunpats
 * date: 2021-08-23
 */
//输出数字端口定义
#define pRed   10   //数字端口10接LED板R端口（红色灯）
#define pGreen 9    //数字端口9接LED板G端口（绿色灯）
#define pBlue  8    //数字端口8接LED板B端口（蓝色灯）
                    //GND接地

void setup() {
    // put your setup code here, to run once:
    // 设置数字端口输出模式
    pinMode(pRed, OUTPUT);
    pinMode(pGreen, OUTPUT);
    pinMode(pBlue, OUTPUT);
    
    Serial.begin(9600);
}

void loop() {
    // put your main code here, to run repeatedly:
    digitalWrite(pRed, HIGH);     //输出高电平亮灯1s
    delay(1000);
    digitalWrite(pRed, LOW);      //输出低电平灭灯3s
    delay(3000);
    Serial.println(pRed);
    
    digitalWrite(pGreen, HIGH);
    delay(1000);
    digitalWrite(pGreen, LOW);
    delay(3000);
    Serial.println(pGreen);
    
    digitalWrite(pBlue, HIGH);
    delay(1000);
    digitalWrite(pBlue, LOW);
    delay(3000);
    Serial.println(pBlue);
}
